home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6924 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: merlin.dclf.npl.co.uk!jrs
  2. From: jrs@dclf.npl.co.uk (Dr John Stockton  NPL UK)
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.msdos.programmer,comp.programming,comp.windows.ms.programmer
  4. Subject: Re: Date Arithmetic
  5. Date: Wed, 21 Feb 1996 10:27:10
  6. Organization: National Physical Laboratory   UK
  7. Message-ID: <jrs.2754.000A7444@dclf.npl.co.uk>
  8. References: <4g19kp$640@tracy.protocom.com>
  9. NNTP-Posting-Host: merlin.dclf.npl.co.uk
  10. X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
  11.  
  12. In article <4g19kp$640@tracy.protocom.com> "Michael J. Karas" <mkaras@pclink.com> writes:
  13.  
  14. >I am working on an algorithm for a laser marking machine that writes
  15. >expiration delays on to food product boxes. The algorithm needs to 
  16. >be able to add NNN days to todays date in the fastest manner possible
  17. >without using any floating point arithmetic. I could use help from anyone
  18. >that has C code for doing this. It would be nice if the solution took the
  19. >leap year problem in to account including the special case of the year 
  20. >2000. Thanks in advance to anyone who could share their knowledge on this 
  21. >subject.
  22.  
  23. In practice, 2000 is not special.  The 100 year & 400 year rules cancel.  
  24. Every fourth year from 1901 to 2099 is leap.
  25. -- 
  26. John Stockton : mailto:JRS@dclf.npl.co.uk from off-site.  MIME.  WP.
  27.  National Physical Laboratory, Teddington, Middlesex, TW11 0LW, UK
  28.   Direct Telephone +44 181-943 6087, Nearby Fax +44 181-943 7138   
  29.    Offshore news still takes up to a week to get here;  please 
  30.     E-mail me a copy of non-UK non-pascal non-TV followups !  
  31.      Regret system puts unzoned (UK civil) time on messages.
  32.